An increasingly popular mechanism for extending operating systems or applications is the use of extensions that can provide additional functionality and can be delivered and invoked on an individual basis. Modern operating systems, for example, rely on extensions provided by hardware manufacturers to interface between the hardware components made by the hardware manufacturers and the operating system software. In such a manner, an operating system author need only provide general hardware support, and need not attempt to support every conceivable hardware device. When a new hardware device is added to a computing system on which the operating system is running, an extension specifically designed to interface between the new hardware device and the operating system can be provided by the hardware manufacturer and can be used by the operating system to control the new hardware device and provide the user access to the functionality of the new hardware device.
In addition to the operating system, many other software applications rely on extensions to provide additional functionality while reducing the complexity of the host application. For example, a web browser application can rely on extensions to provide users the ability to interpret or interact with a wide variety of data types. Thus, a web browser need only provide the ability to handle limited types of data, such as web pages written in the HyperText Markup Language (HTML) or images encoded using the Joint Photographic Experts Group (JPEG) encoding format. Web pages that require additional capabilities of the browser application can rely on custom extensions for the browser application to provide the required capabilities. For example, a web page author that wishes to use images encoded in a little-used format can provide an extension that can understand the particular image format and can interface with the web browser to enable the web browser to display images encoded using that format.
Other applications can also use extensions to provide increased functionality. For example, image processing applications can use extensions provided by a variety of artists to allow users access to many different artistic image processing algorithms developed by those artists. An image processing program can, therefore, provide basic image editing features, such as color and contrast controls. More complex features, such as an effect that appears to transform a photograph into an oil painting, can be provided by separately available extensions. In such a manner, users of image processing applications can individually select which extensions are most appropriate for their requirements and can choose to install only those extensions that may be useful given those requirements.
In general, extensions interact with host software applications through various application program interfaces (APIs). An API defines the manner in which various features or abilities are to be accessed. Thus, two components are said to interact through an API when one component comprises code and data for implementing a particular function and provides that the function is invoked in the manner defined by the API, and a second component requests the function in the manner defined by the API.
The interaction between an extension and a host software application generally occurs through two types of APIs: service APIs and support APIs. Support APIs can be implemented by the host software application, operating system, or any other software that can be used by the extension to access functionality provided by the host software application. Furthermore, support APIs can be layered, or stacked, such that some support APIs may rely on further support APIs to perform requested functions. Service APIs, on the other hand, can be implemented by the extension and can be used by the host software application to access the functionality provided by the extension. As an example, an extension to a web browser that enables the web browser to display images encoded in a particular format can expose service APIs that the web browser can use to pass the image data to the extension and request that the extension interpret the image data, while the web browser can provide support APIs that can provide basic services that the extension can request from the web browser.
Many extensions, especially operating system extensions, such as those designed to interface with hardware devices, can rely on multiple support APIs to appropriately interface with hardware. Many hardware devices that can be added to a modern computing device physically interface with the computing device though ports that are controlled by dedicated circuitry or processing units. The operating system's support APIs can provide mechanisms by which the dedicated circuitry can be used by an extension in order for the extension to access and control the hardware device for which it was designed. For example, an operating system can provide support APIs that allow extensions access to specific areas of random access memory that are set aside for hardware input/output communications. Alternatively, an operating system can provide support APIs that allow extensions to access hardware input/output ports directly.
The extensions, on the other hand, can provide service APIs to allow the operating system or other software applications to access the functionality provided by the extension. For example, a device driver for a new display device can comprise code and data for controlling the display device. That code and data of the display device driver can be invoked by other code, such as operating system code or software application code in a predefined manner through the use of the service APIs. In the example of a display device driver, the service APIs can include APIs for requesting the display of image data, APIs for requesting information from the display, such as its current resolution, and APIs for requesting the activation of energy saving features of the display.
Unfortunately, because host software applications and extensions are generally authored by different individuals, it can be common that the extension does not interface properly with the host program. For example, some extensions, may not properly use the support APIs provided by the host software application, passing improper parameters, data or otherwise improperly requesting various functions. Other extensions may attempt to bypass the support APIs entirely and access functionality directly instead of through the host software application, such as disk access, screen access, and the like. Alternatively, extensions can also attempt to access support APIs that were not intended for use by extensions, such as APIs that are not fully documented or were intended only for internal use within the software application itself.
An extension that does not properly interface with its host software application can result in a failure of the overall host software application, or even the entire computing system. This can be especially problematic when the user of the host software application is forced to rely on multiple extensions from multiple parties simultaneously, such as the myriad of third-party device drivers commonly used by a modern operating system. Furthermore, such failures are often difficult to diagnose and properly support because, while the host software application may be blamed by the user, it is, in fact, the extension that is the cause of the instability. Therefore, it is desirable to create an extension environment that can provide access to the features and abilities of the extension to the host software application while insulating the host software application from instability that may be introduced by the extension.